package com.hzw.saas.api.old.storage.bo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hzw.saas.api.old.storage.constants.StatusString;
import com.hzw.saas.common.util.constants.PatternConsts;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 目录信息模型
 *
 * @author zzl
 * @since 02/19/2021
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
// @ApiModel("资源目录")
public class ResourceFolderBO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 目录ID
     */
    @ApiModelProperty(value = "目录ID", position = 1)
    private String folderId;

    /**
     * 父目录ID
     */
    @ApiModelProperty(value = "父目录ID", position = 2)
    private String parentId;

    /**
     * 目录名称
     */
    @ApiModelProperty(value = "目录名称", position = 3)
    private String name;

    /**
     * 目录状态
     *
     * @see javax.annotation.Resource
     */
    @ApiModelProperty(value = "目录状态, " + StatusString.RESOURCE_STATUS, position = 4)
    private Integer status;

    /**
     * 存储桶
     */
    @ApiModelProperty(value = "存储桶", position = 5, hidden = true)
    private String catalog;

    /**
     * 创建者ID
     */
    @ApiModelProperty(value = "创建者ID", position = 6)
    private String creatorId;

    /**
     * 创建者名称
     */
    @ApiModelProperty(value = "创建者名称", position = 7)
    private String creatorName;

    /**
     * 所有者ID（用户或共享空间）
     */
    @ApiModelProperty(value = "目录所有者ID", position = 8)
    private String ownerId;

    /**
     * 所有者名称
     */
    @ApiModelProperty(value = "所有者名称", position = 9)
    private String ownerName;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间, format=" + PatternConsts.NORM_DATETIME_PATTERN, position = 10)
    @DateTimeFormat(pattern = PatternConsts.NORM_DATETIME_PATTERN)
    @JsonFormat(pattern = PatternConsts.NORM_DATETIME_PATTERN)
    private Date createDate;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间, format=" + PatternConsts.NORM_DATETIME_PATTERN, position = 11)
    @DateTimeFormat(pattern = PatternConsts.NORM_DATETIME_PATTERN)
    @JsonFormat(pattern = PatternConsts.NORM_DATETIME_PATTERN)
    private Date updateDate;

    /**
     * 子目录列表
     */
    @ApiModelProperty(value = "子目录列表", position = 12)
    private List<ResourceFolderBO> subFolders = new ArrayList<>();

    /**
     * 子文件列表
     */
    @ApiModelProperty(value = "子文件列表", position = 13)
    private List<ResourceFileBO> subFiles = new ArrayList<>();

}
